package com.kuang.client.Demo04;

import com.kuang.client.Demo02.UserService;
import com.kuang.client.Demo02.UserServiceImpl;

public class Client {
    public static void main(String[] args) {
        //真实角色
        UserService service = new UserServiceImpl();
        //代理角色，不存在
        ProxyInvocationHandler pih = new ProxyInvocationHandler();

        //设置传入你要代理的对象
        pih.setTarget(service);

        //动态生成代理类
        UserService porxy = (UserService) pih.getPorxy();
        porxy.add();
    }
}
